old_protocol = "8" # Backward compat. with old numbering scheme.
old_script = "8003"
</header>
<description>
≤GB≥Simple Mail Transfer Protocol≤P≥
The standard protocol used to transfer electronic mail on the Internet, as defined in ≤U2≥RFC 821≤P0≥. The default TCP port number for SMTP connections is port 25.
This probe tries to verify that a specified email address exists on the SMTP server, using the VRFY command. It connects to the SMTP server, introduces itself using the HELO command, then issues a VRFY command for the specified email address. When it has received a response, the script sends the QUIT command before closing its connection to the server.
≤i≥Email Address≤p≥ is the name or email address that we are attempting to verify.
</description>
<parameters>
"Email Address" = "postmaster"
</parameters>
<script>
CONN #60 (connect timeout in secs)
WAIT #30 @IDLE (idle timeout in secs)
MTCH "220" else goto @UNEXPECTED_GREETING
EXPT "220 " else goto @DISCONNECT
SEND "HELO [${_LOCALADDRESS}]\r\n"
MTCH "250" else goto @BAD_HELO_RESPONSE
EXPT "250 " else goto @DISCONNECT
SEND "VRFY ${Email Address}\r\n"
MTCH m"^25[0-9]" else goto @BAD_VRFY_RESPONSE
EXPT m"^25[0-9] " else goto @DISCONNECT
SEND "QUIT\r\n"
MTCH "221" #+2
EXPT "221 " #+1
DONE OKAY
@UNEXPECTED_GREETING:
STAT DOWN "[SMTP] Unexpected greeting from port ${_REMOTEPORT}. (${_LINE:50})"
SEND "QUIT\r\n"
MTCH "221" #+2
EXPT "221 " #+1
EXIT
@BAD_HELO_RESPONSE:
STAT ALRM "[SMTP] Unexpected response to HELO command. (${_LINE:50})"
SEND "QUIT\r\n"
MTCH "221" #+2
EXPT "221 " #+1
EXIT
@BAD_VRFY_RESPONSE:
MTCH "550" else goto @VRFY_NOT_IMPLEMENTED
SEND "QUIT\r\n"
MTCH "221" #+2
EXPT "221 " #+1
DONE OKAY
@VRFY_NOT_IMPLEMENTED:
MTCH "502" else goto @UNEXPECTED_VRFY_RESPONSE
SEND "QUIT\r\n"
MTCH "221" #+2
EXPT "221 " #+1
DONE OKAY
@UNEXPECTED_VRFY_RESPONSE:
STAT ALRM "[SMTP] Unexpected response to VRFY command. (${_LINE:50})"
SEND "QUIT\r\n"
MTCH "221" #+2
EXPT "221 " #+1
EXIT
@IDLE:
DONE DOWN "[SMTP] No data for ${_IDLETIMEOUT} seconds. Was expecting \"${_STRINGTOMATCH}\". [Line ${_IDLELINE}]"
@DISCONNECT:
DONE DOWN "[SMTP] Connection disconnected while expecting \"${_STRINGTOMATCH}\"."